<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/pagination.tld" prefix="page"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

	String week = "1";
	if(null!=request.getParameter("week")){week = request.getParameter("week");}
	if(null!=request.getAttribute("week")){week = (String)request.getAttribute("week");}
	//月主题id
	String cmonthId= request.getParameter("cmonthId");
	if(null!=request.getParameter("cmonthId")){cmonthId = request.getParameter("cmonthId");}
	if(null!=request.getAttribute("cmonthId")){cmonthId = (String)request.getAttribute("cmonthId");}
	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'zhouzhuti_content.jsp' starting page</title>
   <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=path %>/reference/css/Beike.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<%=path %>/reference/js/jquery.js"></script>
	<script type="text/javascript">
		
		//删除周主题内容
		function delweekcontent(id){
			if(window.confirm("确定要删除吗？")){
			var week = $("#week").val();
			var monthId = $("#cmonthId").val();
			window.location.href="<%=path %>/beike/iweekcontent.do?method=delIWeekcontent&id="+id+"&week="+week+"&cmonthId="+monthId+"&targetId=${targetId}&month=${month}&edit=${edit}";
			}
			
		}
		//编辑
		function editcontent(tid){
				
				document.getElementById("subbtton").src="<%=path %>/reference/images/button_save.gif";
				document.getElementById("frm").action="<%=path %>/beike/iweekcontent.do?method=updateIWeekcontent&cid="+tid;
				$("#iweekContent").val($("#td"+tid).text());
				
			}
	</script>
  </head>
  
  <body>
  				<form action="<%=path %>/beike/iweekcontent.do?method=saveIWeekcontent" name="frm" id="frm" method="post">
  				<input type="hidden" name="month" id="month" value="${month }" />
  				<input type="hidden" name="targetId" id="targetId" value="${targetId }" />
  				<input type="hidden" name="edit" id="targetId" value="${edit }" />
  				
  				
  				<input type="hidden" name="week" id="week" value="<%=week %>" />
  				<input type="hidden" id="cmonthId" name="cmonthId" value="<%=cmonthId %>" />
                 <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#cfe5f5">
				  	<tr>
						<td colspan="4"><table width="100%" height="20px;" border="0" cellpadding="3" cellspacing="1" bgcolor="#e6f0f8">
							  <tr>
								<td width="100%"><strong>周单元主题：</strong><input type="text" value="${weekThemeName }" name="weekThemeName" size="100" /></td>
							  </tr>
						</table></td>
					</tr>
                    <tr>
                      <td width="6%" height="25" bgcolor="#a4c9ec">序号&nbsp;</td>
                      <td width="66%" height="25" align="center" bgcolor="#a4c9ec"><strong>目标内容</strong></td>
                      <td width="11%" align="center" bgcolor="#a4c9ec"><strong>编 辑</strong></td>
                      <td width="17%" align="center" bgcolor="#a4c9ec"><strong>删 除</strong></td>
                    </tr>
                    <c:forEach items="${weekcontents}" var="weekcontent" varStatus="staut">
                    <tr>
                      <td width="6%" height="30" bgcolor="#FFFFFF">${staut.count+(currPage-1)*pageSize }.</td>
                      <td height="30" align="center" bgcolor="#FFFFFF" id="td${weekcontent.id }">${ weekcontent.weekContent}</td>
                      <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:editcontent(${weekcontent.id });"><img src="<%=path %>/reference/images/bianji.gif" alt="" width="16" height="16" border="0"></a></td>
                      <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:delweekcontent(${weekcontent.id });"><img src="<%=path %>/reference/images/de.gif" alt="" width="16" height="16" border="0"></a></td>
                    </tr>
                </c:forEach>
                  </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                      <td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td align="right">
                                  <page:Pagination url="${pageContext.request.contextPath}/beike/iweekcontent.do?method=getIWeekcontent" currPage="${empty currPage?1:currPage}" pageAmount="${pageAmount}" pageSize="${empty pageSize?10:pageSize}" type="post" form="frm" />
				           </td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
                  
                  
                      <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                      <td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td width="68%" align="right"><input name="iweekContent" id="iweekContent" type="text" style="width:100%" ></td>
                            <td width="32%"><a href="javascript:frm.submit();"><img src="<%=path %>/reference/images/button_add.gif" id="subbtton" width="44" height="20" border="0"></a></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table>
				  
				  
		</form>
  </body>
</html>
